<?php

namespace common;

use think\facade\Request;
use think\facade\Db;

class Nodes
{

    /**
     * 查询节点
     * @author lijia
     * @date 2019-08-08
     */
    static public function lists($menuStatus=0)
    {
		if($menuStatus){
			$list = Db::name("auth_nodes")->where("menustatus",1)->order('sort')->select()->toArray();
		}else{
        	$list = Db::name("auth_nodes")->order('sort')->select()->toArray();
		}
        $nodes = array();
        if (!$list) return [];
        foreach ($list as $key => $val) {
            $nodes[$val['id']] = $val;
        }
        return $nodes;
    }


}
